/*#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

int main() {
    int i;
    int seed = 1000;
    int numPlayer = 6;
    int maxBonus = 10;
    int p, r, handCount;
    int bonus;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;
    int maxHandCount = 5;
    // arrays of all coppers, silvers, and golds

	memset(&G, 23, sizeof(struct gameState));   // clear the game state
    r = initializeGame(numPlayer, k, seed, &G); // initialize a new game

    printf ("TESTING updateCoins():\n");
    for (p = 0; p < numPlayer; p++)
    {
        for (handCount = 1; handCount <= maxHandCount; handCount++)
        {
            for (bonus = 0; bonus <= maxBonus; bonus++)
            {
#if (NOISY_TEST == 1)
                printf("before random card play\n");
#endif
            



			
#if (NOISY_TEST == 1)
                printf("all match (%d) ", i);
#endif
		


				
				
#if (NOISY_TEST == 1)
                printf("all match (%d) ", i);
#endif

				



#if (NOISY_TEST == 1)
                printf("all match (%d)\n", i);
#endif
            }
        }
    }

    printf("All tests passed!\n");

    return 0;
}
*/

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "rngs.h"
#include <time.h>

int main()
{
    srand(time(NULL)); //randomize based on time clock
        
    int numPlayer = 2;
    int bonus = 2;
    int i;
    int DC; //deck count
    int HC; //Hand count
   int seed = rand() % 5000 + 7; //set the random seed
    
    struct gameState G;
    int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, sea_hag, tribute, smithy};

   for (i = 0; i < 1000; i++) {
            memset(&G, 23, sizeof(struct gameState)); // reset game state
                initializeGame(numPlayer, k, seed, &G);

                G.handCount[0] = rand() % 10;
                G.deckCount[0] = rand() % 50 + 30;

                G.whoseTurn = 0;
                //put the garden card in the hand
                G.hand[0][0] = gardens; 
                DC = G.deckCount[0];
                HC = G.handCount[0];

              printf("Deck Start: (%d)\n", G.deckCount[0]);        
             printf("Hand Start: (%d)\n", G.handCount[0]);

             cardEffect(gardens, 0, 0, 0, &G, 0, &bonus);

            printf("Deck END: (%d)\n", G.deckCount[0]);
             if ((DC - G.deckCount[0]) == 3)
             	{printf("deck count looks good.\n");}
             printf("Hand END: %d\n", G.handCount[0]);
             if (G.handCount[0] == (HC + 2))
             	{printf("hand count looks good\n");}
        }

        printf("All tests passed!\n");

        return 0;
}